
//
//  ErLouController.m
//  民族文化宫
//
//  Created by WANG CUNRUI on 14-6-7.
//  Copyright (c) 2014年 WANG CUNRUI. All rights reserved.
//

#import "ErLouController.h"

@interface ErLouController ()
@property (strong, nonatomic) UIImageView *imageView;
@property (strong, nonatomic) UIButton *button1;
@property (strong, nonatomic) UIButton *button2;
@property (strong, nonatomic) UIButton *button3;
@property (strong, nonatomic) UIButton *button4;
@end

@implementation ErLouController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.edgesForExtendedLayout = UIRectEdgeNone;
    CGRect frame = self.view.bounds;
    CGSize f = frame.size;
    CGFloat h = f.height;
    CGFloat w = f.width;
    self.imageView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"112.jpg"]];
    self.imageView.frame  = CGRectMake(0, 0, w, h-110);
    [self.view addSubview:self.imageView];
    _button1 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button1.frame = CGRectMake(20, 0.078*h, 100, 90);
    [_button1 setBackgroundColor:[UIColor blackColor]];
    [_button1 addTarget:self action:@selector(butClick1:) forControlEvents:UIControlEventTouchUpInside];
    _button1.tag = 1;
    [self.view addSubview:_button1];
    _button2 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button2.frame = CGRectMake(30, 0.078*h, 100, 90);
    [_button2 setBackgroundColor:[UIColor clearColor]];
    [_button2 addTarget:self action:@selector(butClick1:) forControlEvents:UIControlEventTouchUpInside];
    _button2.tag = 2;
    [self.imageView addSubview:_button2];
    _button3 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button3.frame = CGRectMake(30, 0.078*h, 100, 90);
    [_button3 setBackgroundColor:[UIColor clearColor]];
    [_button3 addTarget:self action:@selector(butClick1:) forControlEvents:UIControlEventTouchUpInside];
    _button1.tag = 3;
    [self.imageView addSubview:_button3];
    _button4 = [UIButton buttonWithType:UIButtonTypeCustom];
    _button4.frame = CGRectMake(30, 0.078*h, 100, 90);
    [_button4 setBackgroundColor:[UIColor clearColor]];
    [_button4 addTarget:self action:@selector(butClick1:) forControlEvents:UIControlEventTouchUpInside];
    _button4.tag = 4;
    [self.imageView addSubview:_button4];


//    self.view.backgroundColor = [UIColor blueColor];
    // Do any additional setup after loading the view.
}

- (void)butClick1:(UIButton *)but
{
    CGPoint point = CGPointMake(200, 200);
    _popView = [[MZdetail alloc]initWithFrame:CGRectMake(200, 200, 100, 100)];
    
    [self initWithCoordinateInPoint:point Inview:self.view withContentView:_popView delegate:self];
    
}

-(void)initWithCoordinateInPoint:(CGPoint)point Inview:(UIView*)view withContentView:(UIView *)cView delegate:(id<PopoverViewDelegate>)delegate
{
  
   [PopoverView showPopoverAtPoint:point inView:view withContentView:cView delegate:delegate];
    
}





- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
